
package entity;

import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

/**
 *
 * @author wangbh
 */
public class UserMapper implements FieldSetMapper<User>{

    public User mapFieldSet(FieldSet fieldSet) throws BindException {
        User u = new User();
        u.setName( fieldSet.readString(0) );
        u.setAge( fieldSet.readString(1) );
        return u;
    }

}
